;----------------------------------------------------------------------------
;undefined data (link this last)
;----------------------------------------------------------------------------
.486p
.model flat
.data?

        include equates.h

        public codelist
        public input_buff
        public vesamodes
        public fullpal
        public filename
        public startdir
        public tempdir
        public mapperdata
        public memmap
        public kb_table
        public ram
        public oam
        public spritecount
        public spritelist
        public vram
        public spritemask
        public vscreen
        public vscreen2
        public attrib
        public mixbuff
        public freqtbl
        public ch1buff
        public ch2buff
        public ch3buff
        public ch4buff
        public ch5buff
        public mbuff
        public tmp
        public heap
        public stackend
;----------------------------------------------------------------------------

input_buff      db      BUFFSIZE dup (?)        ;debug command input buffer
vesamodes       dw      256 dup (?)             ;VESA mode list
fullpal         dd      256 dup (?)             ;current palette; this is kept mainly for 32bit color mode. (0-3f)
filename        db      256 dup (?)             ;path/filename+'.'
startdir        db      128 dup (?)             ;starting directory
tempdir         db      128 dup (?)             ;for savedir
mapperdata      db      MAPDATASIZE dup (?)     ;used in state saving
memmap          dd      8 dup (?)               ;NES memory map.  must be at least 256 byte aligned.
kb_table        db      100h dup (?)            ;table of keys held
ram             db      10100h dup (?)          ;64k NES RAM
oam             db      100h dup (?)            ;OAM
spritecount     db      256 dup (?)             ;sprites per line
spritelist      dd      8*256 dup (?)           ;holds sprite data for each line.  Y byte is replaced by sprite line #.
vram            db      4000h dup (?)           ;VRAM
spritemask      db      264 dup (?)             ;priority buffer
vscreen         db      264*249 dup (?)         ;offscreen buffer..  249 for extra space (BG tile overdraw)
vscreen2        db      264*241 dup (?)         ;another offscreen buffer (GUI bg)
attrib          dd      32*32*4 dup (?)         ;unpacked attrib table
freqtbl         dd      2048 dup (?)            ;NES freq tbl
ch1buff         db      CH1SIZE*8 dup (?)       ;sound channel command buffers
ch2buff         db      CH1SIZE*8 dup (?)       ;(cyclic queue)
ch3buff         db      CH1SIZE*8 dup (?)       ;
ch4buff         db      CH1SIZE*8 dup (?)       ;
ch5buff         db      CH5SIZE*8 dup (?)       ;
mixbuff         dd      MIXSIZE dup (?)         ;mixer buffer

mbuff           db      MSIZE dup (?)           ;buffer for movie play/record
codelist        db      MAXCODES*16 dup (?)     ;game genie code list
tmp             db      TMPSIZE dup (?)         ;obsolete.  stop using this
heap            db      HEAPSIZE dup (?)        ;big heap
                db      400h dup (?)            ;stack goes here
stackend        label byte                      ;end of code segment
;----------------------------------------------------------------------------
        end
